#ifndef FILESYSTEM_H
#define FILESYSTEM_H

#include "basicsCommand.hpp"
#include "Singleton.hpp"
#include "command.h"
#include "IOControlLayer.h"

#include <sstream>
#include <iostream>

enum class CommandType {
    MKDIR,
    LS,
    CD,
    TOUCH,
    CAT
};

class FileSystem : public Singleton<FileSystem> {
    friend class Singleton<FileSystem>;
protected:
    FileSystem();
    ~FileSystem();
public:
    std::string command(const std::string& command);
    void setPwd(const std::string& path);
    std::string getPwd();
private:
    BasicsCommand* plantDataModel(std::string_view type);
    void initCommandTypes();
    
private:
    std::unordered_map<std::string, BasicsCommand*> redis;
    std::unordered_map<std::string_view, CommandType> commandTypes;
    std::string pwd{"/"};
};

#endif // FILESYSTEM_H